#include "ColumnDef.h"
#include <stdexcept>

std::string columnTypeToString(ColumnType type)
{
    if (type == ColumnType::INT) {
        return "INT";
    } else if (type == ColumnType::TEXT) {
        return "TEXT";
    }
    throw std::runtime_error("Unknown column type");
}

ColumnType stringToColumnType(std::string_view type) {
    if (type == "INT") {
        return ColumnType::INT;
    } else if (type == "TEXT") {
        return ColumnType::TEXT;
    }
    throw std::runtime_error("Unknown column type");
}